package edu.yctc.origin.service;

import edu.yctc.origin.entity.ResultDO;
import edu.yctc.origin.entity.UserDO;

/**
 * userService接口
 * 
 * @author 赵宜珺
 */
public interface UserIService {

    /**
     * 登陆
     * 
     * @param userDO
     * @return
     */
    public ResultDO<Long> signin(UserDO userDO);

    /**
     * 通过id返回userDO
     * 
     * @param id
     * @return
     */
    public ResultDO<UserDO> getUserDOById(long id);

    /**
     * 改密
     * 
     * @param userDO
     * @param oldPassword
     * @param newPassword
     * @return
     */
    public ResultDO<Void> updatePassword(UserDO userDO, String oldPassword, String newPassword);

    /**
     * 通过邮箱找到userDO
     *
     * @param mail
     * @return
     */
    public ResultDO<UserDO> getUserDOByMail(String mail);

    /**
     * 邮箱找密
     *
     * @param mail
     * @param newPassword
     * @return
     */
    public ResultDO<Void> retrievePasswordByMail(String mail, String newPassword);

    /**
     * 修改邮箱
     *
     * @param userDO
     * @param mail
     * @return
     */
    public ResultDO<Void> updateMail(UserDO userDO, String mail);

}
